1. Technical Field
The present invention relates in general to a method and system for data processing and in particular to a method and system for executing a program within a data processing system under one of a plurality of mutually exclusive operating systems. Still more particularly, the present invention relates to a method and system for executing a program within a data processing system which hibernate a primary operating system in response to invocation of a program which requires a secondary operating system.
2. Description of the Related Art
As computer operating system technology advances, continued support of the vast body of existing software becomes increasingly difficult. For example, current state-of-the-art multithreaded, multitasking operating systems such as OS/2(trademark) have some difficulty in supporting programs developed for a previous generation of operating system, such as DOS. The difficulty current operating systems encounter in supporting programs written for prior operating systems arise chiefly due to the fact that the programs, when written, were targeted for use within a single-user computer system running a single-threaded operating system. Because these computer systems are capable of running only a single execution thread for a single user, rules of acceptable policy within the computer system are often nonexistent. To take advantage of the performance benefits which result from unlimited software control of system operations, programs written for such an environment often contain their own device drivers and directly manage system hardware, for example, interval timers. In fact, such programs often do not run correctly if other device drivers (i.e., operating system device drivers) are already loaded within the computer system.
In contrast to such prior operating system environments, current multithreaded, multitasking operating systems run in a protected environment, for example, the protected mode supported by 80xc3x9786 processors, which enables system resources to be shared concurrently by multiple tasks and which prevents a particular task from monopolizing the system resources. Thus, a problem arises when attempting to run programs written for prior generation single-threaded operating systems which directly and often exclusively manage system hardware. Because of the conflict between the exclusive control of system resources required by the single-user, single-threaded prior generation operating systems and current multithreaded, multitasking operating systems, programs which require the single-threaded operating systems cannot be run as a task under current multithreaded, multitasking operating systems.
Accordingly, several schemes have been developed to support applications which required a single-user, single-threaded operating system environment. A first scheme involves partitioning the primary boot device (e.g., hard disk drive) and installing single-threaded and multithreaded operating systems within separate partitions. A operating system boot manager queries a user upon startup which operating system is preferred. Thereafter, the user must reboot the computer to switch between the multiple operating systems as required by the applications to be executed. Thus, in a typical computing scenario, the user boots a first operating system to run a first program, exits the first operating system, and then boots a second operating system to execute a second program. This scheme provides less than desirable performance due to the time required to boot an operating system prior to launching particular applications.
A similar scheme utilized to support multiple incompatible operating systems is called a xe2x80x9cdual boot.xe2x80x9d In a dual boot scenario, two operating systems and their associated initialization files may be stored within the same hard disk partition. In response to a user command to boot the alternate operating system, the boot block and initialization files (CONFIG.SYS file and AUTOEXEC.BAT) of the current operating system are stored with modified file extensions (e.g., CONFIG.DOS) and the boot block and initialization files of the alternate operating system are renamed to the specified system names. When the data processing system is subsequently reset, the alternate operating system will boot. The dual boot scheme suffers the same disadvantage as the partitioned disk scheme in that the delay encountered when launching particular applications is unacceptably long because of the additional time required to boot the appropriate operating system.
Consequently, it would be desirable to provide an improved method and system for executing a program within a data processing system under one of a plurality of mutually exclusive operating systems. In particular, it would be desirable to provide a method and system which efficiently facilitate execution of a program requiring a different operating environment.
It is therefore one object of the present invention to provide an improved method and system for data processing.
It is another object of the present invention to provide an improved method and system for executing a program within a data processing system under one of a plurality of mutually exclusive operating environments.
It is yet another object of the present invention to provide an improved method and system for executing a program within a data processing system which hibernate a primary operating system in response to invocation of a program which requires a secondary operating system or an unrestricted operating environment.
It is still another object of the present invention to provide a method and system for hibernating the primary operating system of a data processing system and loading a secondary operating system or unrestricted operating environment in a manner which is transparent to the user.
The foregoing objects are achieved as is now described. A method and system within a data processing system for executing a program under one of a number of mutually exclusive operating systems are disclosed. The data processing system includes a nonvolatile mass storage device, a volatile memory, and a processor. According to the present invention, a program which executes under a second operating system is invoked while the processor is executing a first operating system. In response to invocation of the program, the data processing system is forced to a quiescent state. A state of the first operating system is then determined from contents of the volatile memory and stored within either the volatile memory or the nonvolatile mass storage device. In response to storage of the state of the first operating system, at least a portion of the second operating system is automatically loaded into the volatile memory. Thereafter, the program is executed under the second operating system, wherein interchange between mutually incompatible operating systems within a single data processing system is efficiently accomplished. In a preferred embodiment of the present invention, the method of the present invention is embodied within a computer program product for causing a data processing system to perform the foregoing steps.
The above as well as additional objects, features, and advantages of the present invention will become apparent in the following detailed written description.